import base from '@/api/baseurl';
import request from '@/utils/request'

/**
 * 查询法人
 * @param {*} query
 * @returns
 */
export function fetchList(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/JudgeManage/Find',
    method: 'get',
    params: query
  })
}

/**
 * 增加法人
 * @param {*} data
 * @returns
 */
export function addLegalPerson(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/JudgeManage/insert',
    method: 'post',
    data
  })
}

/**
 * 修改法人
 * @param {*} data
 * @returns
 */
export function updateLegalPerson(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/JudgeManage/update',
    method: 'post',
    data
  })
}

/**
 * 删除法人-单条
 * @param {*} query
 * @returns
 */
export function deleteLegalPerson(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/JudgeManage/del',
    method: 'get',
    params: query
  })
}

/**
 * 删除法人--多条
 * @param {*} data
 * @returns
 */
export function deleteBatchLegalPerson(data) {
  return request({
    baseURL: base.appBaseApi,
    url: '/JudgeManage/delMany',
    method: 'post',
    data
  })
}

/**
 * 查询机构树
 * @param {*} query
 * @returns
 */
export function legalLoadBranchTree(query) {
  return request({
    baseURL: base.appBaseApi,
    url: '/organization/findorganizationlp',
    method: 'get',
    params: query
  })
}
